import cv2

# 创建
cv2.namedWindow('newWin', cv2.WINDOW_NORMAL)
cv2.imshow('newWin', 0)

# 第二个参数 0 IMREAD_GRAYSCALE，  1 IMREAD_COLOR default
img = cv2.imread('E:\\yunLiu\\20231030.png', 0)

# 窗口中显示图片
cv2.resizeWindow('newWin', width=800, height=600)

cv2.imshow('newWin', img )


# 等待按键事件
key = cv2.waitKey(0)
if(key == 'q') :
    exit()

# 销毁所有窗口
# cv2.destroyWindow('newWin')
cv2.destroyAllWindows()